<?php
/**
 * 公共加载的数据
 */
//	彩票种类
$lotteryTable = Table('lottery');
$lottery = $db->getall('SELECT * FROM ' . $lotteryTable . ' WHERE status = 1 ORDER BY cate_id ASC','id');
$k3 = $db->getall('SELECT * FROM ' . $lotteryTable . ' WHERE status = 1 and ptid="K3" ');
// ========================================================================
$userMoney = $_SESSION['userlast']['money'];
// 查询所有彩种类别
$getCateSql  = 'SELECT * FROM ' . Table('lottery_category') . ' WHERE status = 0';
$cateList    = $db->getall($getCateSql);
$cateIdKey   = array();

foreach ($cateList as $ck => $cv){
    $cateIdKey[$cv['id']] = $cv;
}
// 查询所有彩种
$getLottSql  = 'SELECT * FROM ' . $lotteryTable . ' WHERE status = 1';
$lottList    = $db->getall($getLottSql);
$lottCateKey = array();
// 彩种按照类别Key化
foreach ($lottList as $k => $v){
    $lottCateKey[$v['cate_id']][] = $v;
}